
#pragma once

class CPropertiesToolBar : public CMFCToolBar
{
public:
	virtual void OnUpdateCmdUI(CFrameWnd* /*pTarget*/, BOOL bDisableIfNoHndler)
	{
		CMFCToolBar::OnUpdateCmdUI((CFrameWnd*) GetOwner(), bDisableIfNoHndler);
	}

	virtual BOOL AllowShowOnList() const { return FALSE; }
};

class CPropertiesWnd : public CDockablePane
{
// Construction
public:
	CPropertiesWnd();

	void AdjustLayout();

// Attributes
public:
	void SetVSDotNetLook(BOOL bSet)
	{
		m_wndPropList.SetVSDotNetLook(bSet);
		m_wndPropList.SetGroupNameFullWidth(bSet);
	}

protected:
	CFont					m_fntPropList;
	CComboBox				m_wndObjectCombo;
	TNaviTBarBase<CPropertiesToolBar> m_wndToolBar;
	CMFCPropertyGridCtrl	m_wndPropList;

// Implementation
public:
	virtual ~CPropertiesWnd();
	void ShowPropList();
	void AddEntity(const ULONG &id);
protected:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnExpandAllProperties();
	afx_msg void OnUpdateExpandAllProperties(CCmdUI* pCmdUI);
	afx_msg void OnSortProperties();
	afx_msg void OnUpdateSortProperties(CCmdUI* pCmdUI);
	afx_msg void OnSetFocus(CWnd* pOldWnd);
	afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
	afx_msg void OnComboBoxSeleChange();
	DECLARE_MESSAGE_MAP()

	void SetPropListFont();
	void InitComboList();
	void FillPane();
	bool HasActiveDB(TDbDataBase* *pDb = NULL);
	int AddStringAndDataToCombo(TDbDataBase *pDb, const ULONG &id);
public:
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
};

